﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="caigou_Edit.aspx.cs" Inherits="Catering.Catering_Page.Caipin.caigou_Edit" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>食谱采购计划</title>
    <link rel="stylesheet" type="text/css" href="../../Style/head.css" />
    <link rel="stylesheet" type="text/css" href="../../Style/center.css" />
    <link href="../../Style/zhezhao.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../../Style/xxk.js" type="text/javascript"></script>
    <script src="../../Scripts/zhezhao.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="../../Scripts/My97DatePicker/WdatePicker.js"></script>
    <style type="text/css">
        .Create_Recipe{ margin-top: 0;}
        .Create_Recipe { border: 1px solid #159aec; border-top: none; width: 998px; }
        .soso_lt { padding: 5px 0; }
        .soso_lt a { margin-left: 3px; }
        #top_title ul { margin: 0px; }
        #top_title li { float: left; margin-left: 10px; height: 33px; line-height: 33px; width: auto; color: #fff; font-size: 16px; font-weight: 600; }
        #css_table td { border: 0px; text-align: left; }
        #css_xiugai td { padding:0px; height: 25px; }
        .tc_css { border: solid 10px #898989; background: #fff; width: 480px; z-index: 1001; position: absolute; display: none; top: 30%; left: 50%; margin: -140px 0 0 -400px; margin-left: -25%; display: none; }
        .tc_css h2 { width: 100%; height: 30px; line-height: 30px; background: url(../../Images/div_h1_bg_02.gif) 0 0 repeat-x; font-size: 14px; font-weight: 400; }
        .tc_css b {margin-left: 10px; display: block; float: left; }
        .tc_css span { cursor: pointer; margin-right: 10px; display: block; float: right; }
        .tc_conter { width: 100%; padding:10px auto; }
        .td_bgcolor td{ background-color:transparent;}
        .swxx_table tbody td{ font-size:12px; padding:4px 0px;}
        #Purchase_Info td{border-bottom:1px dashed #CCCCCC; padding:2px 0px;}
        #shipu_List td{ text-align:center;}
        #jihua_List td{ text-align:center;}
    </style>
    <script language="javascript" type="text/javascript">
        function But_AddRow_Purchase_Click() {
            $.ajax({
                type: "Post",
                url: "../../PostDate.aspx/Raw_Info_List",
                data: "{'Del_DishInfo_ID':'DishInfo '}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    varrowid = $("#newid").val() + 1;
                    var i = 0;
                    var strrowhaead = "<tr>" +
                                "<td>&nbsp;</td>" +
                                "<td><lable id=\"lblguige" + varrowid + "\"> </td>" +
                                "<td>" +
                                "<select id=\"RowSelect" + varrowid + "\" onchange=\"select_Raw(" + varrowid + ")\">";
                    var selectrow;
                    while (data.d[i] != null) {
                        selectrow = selectrow + "    " + "<option value=\"" + i + 1 + "\">" + data.d[i] + "</option>" +
                    i++;
                    }

                    var selectfood = "</select>" +
                                   "</td>" +
                                    "<td><lable id=\"lblguige" + varrowid + "\"> </td>" +
                                    "<td><lable id=\"lbldanwei" + varrowid + "\"> </td>" +
                                    "<td><input type=\"text\" id=\"jihua" + varrowid + "\" /></td>" +
                                    "<td><input type=\"text\" id=\"shiji" + varrowid + "\" /></td>" +
                                    "<td><input type=\"text\" id=\"beizhu" + varrowid + "\" /></td>" +
                                    "<td></td>" +
                                       "</tr>"


                    $("#Purchase_Info").append(strrowhaead + selectrow + selectfood);
                }
            });

        }
        function select_Raw(date) {

            var test = $("#RowSelect" + date).val();

            $.ajax({
                type: "Post",
                url: "../../PostDate.aspx/Raw_Info_List",
                data: "{'Select_Raw_ID':'" + test + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {


                    $("#lbldaima" + date).val(data.d[0].toString());
                    $("#lblguige" + date).val(data.d[1].toString());
                    $("#lbldanwei" + date).val(data.d[2].toString());

                }
            });

        }
        function Svan_Raw() {

            var str_AddPice = "";
            $("#Purchase_Info").each(function () {
                if ($(this).html().toString().indexOf("add") > 0) {
                    str_AddPice = str_AddPice + "|" + $(this).find("[name='daima']").val() +
                        "," + $(this).find("[name='RowSelect']").val() +
                        "," + $(this).find("[name='guige']").val() +
                        "," + $(this).find("[name='danwei']").val() +
                "," + $(this).find("[name='jihua']").val() +
                "," + $(this).find("[name='shiji']").val() +
                "," + $(this).find("[name='beizhu']").val();

                }
            });



            $.ajax({
                type: "Post",
                url: "../../PostDate.aspx/Caigou_Add_Row",
                data: "{'Add_Raw_Info':'" + str_AddPice + "','CGID':'" + $("#dr_Recipes").val() + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    alert(str_AddPice);

                }
            });


        }


        function Del_Purchase_Info(dates) {
            if (!confirm("确定删除?")) {
                return;
            }

            $.ajax({
                type: "Post",
                url: "../../PostDate.aspx/Raw_Info_Del",
                data: "{'Select_Raw_ID':'" + dates + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d == "OK") {
                        alert("删除成功！");
                        history.go(0);
                    }

                }
            });
        }
   
    </script>
    <script language="javascript" type="text/javascript">
        function select_caipu_Click() {

            if ($("#txstoptime").val().length > 0) {
                if ($("#radio_2").attr("checked") != true) {

                    $.ajax({
                        type: "Post",
                        url: "../../PostDate.aspx/CaitouEdit_Select",
                        data: "{'GroupID':'" + $("#drArea").val() + " ','ClassID':'" + $("#HF_ClassID").val() + "','StatTime':'" + $("#txstattime").val() + "','StopTime':'" + $("#txstoptime").val() + "'}",
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function (data) {
                            $("#shipu_List").html(data.d[0]);
                        }
                    });
                } else {
                    $.ajax({
                        type: "Post",
                        url: "../../PostDate.aspx/CaitouTemp_Select",
                        data: "{'GroupID':'" + $("#drArea").val() + " ','ClassID':'" + $("#HF_ClassID").val() + "','StatTime':'" + $("#txstattime").val() + "','StopTime':'" + $("#txstoptime").val() + "','strNumber':'" + $("#txt_Number").val() + "'}",
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function (data) {
                            $("#jihua_List").html(data.d[0]);
                        }
                    });

                }
            }
        }
    </script>
    <script type="text/javascript" language="javascript">
        function showTables(n, num) {
            for (var i = 1; i <= num; i++) {
                if ($GetControl("table_" + i) != null) {
                    $GetControl("table_" + i).style.display = 'none';
                }
                if ($GetControl("radio_" + i) != null) {
                    $GetControl("radio_" + i).checked = '';
                }
            }
            if ($GetControl("table_" + n) != null) {
                $GetControl("table_" + n).style.display = 'block';
            }
            if ($GetControl("radio_" + n) != null) {
                $GetControl("radio_" + n).checked = 'checked';
            }
        }
    </script>
    <script language="javascript" type="text/javascript">
        function select_jighua_List(date) {
            $("#jihua_Id").val(date);
        }
        function select_shipu_List(date) {
            $("#shipu_Id").val(date);
        }
    </script>
    <script type="text/javascript">
        function ShowRecipes() {
            if ($("#radio_1").is(":checked")) {//自动
                var ClassID = $("#HF_ClassID").val();
                var starttime = $("#txstattime").val();
                var endtime = $("#txstoptime").val();

                $.ajax({
                    type: "Post",
                    url: "caigou_Edit.aspx/GetRecipesByZD",
                    data: "{'ClassID':'" + ClassID + "','starttime':'" + starttime + "','endtime':'" + endtime + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        $("#shipu_List").html(data.d);
                    }
                });

            }
            else { //历次采购
                var ClassID = $("#HF_ClassID").val();
                var starttime = $("#txstattime").val();
                var endtime = $("#txstoptime").val();

                $.ajax({
                    type: "Post",
                    url: "caigou_Edit.aspx/GetRecipesByCG",
                    data: "{'ClassID':'" + ClassID + "','starttime':'" + starttime + "','endtime':'" + endtime + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        $("#jihua_List").html(data.d);
                        BingClickByCG();
                    }
                });
            }
        }

        function BingClickByCG() {
            $("input[name='ck_Purchase']").click(function () {
                $("input[name='ck_Purchase']").attr("checked", false);
                $(this).attr("checked", true);
            });
        }

        //生成食谱
        function AutoGenerate() {
            var obj = document.getElementById("KaiShiSC");
            if (obj) obj.style.display = "none";
            if ($("#radio_1").is(":checked")) {//自动
                var starttime = $("#txstattime").val();
                var endtime = $("#txstoptime").val();
                var CID = $("#HidCID").val();
                var weektime = "";
                var RecipesIDlist = "";
                var shipunum = 0;
                $("#shipu_List").find(":checkbox:checked").each(function () {
                    RecipesIDlist += $(this).val() + ",";
                    weektime += document.getElementById('cbo' + $(this).val()).value + ",";
                    shipunum++;
                });
                if (shipunum > 0) {
                    $.ajax({
                        type: "Post",
                        url: "caigou_Edit.aspx/AutoGenerate",
                        data: "{'starttime':'" + starttime + "','endtime':'" + endtime + "','RecipesID':'" + RecipesIDlist + "','CID':'" + CID + "','weekTime':'" + weektime + "'}",
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function (data) {
                            if (data.d == "OK") {
                                alert("生成成功！");
                                history.go(0);
                            }
                            else {
                                alert("生成失败！");
                            }
                        }
                    });
                }
                else {
                    alert("请选择要生成的列表！");
                }
            }
            else { //历次采购模版
                var CountRen = $("#txt_Number").val();
                if (CountRen == "" || isNaN(CountRen)) {
                    alert("请输入人数！");
                    if (obj) obj.style.display = "";
                    return;
                }
                var PurchaseID = $("#jihua_List").find(":checkbox:checked").val();
                var CID = $("#HidCID").val();
                if (CountRen == "" || CID == "")
                    return;

                $.ajax({
                    type: "Post",
                    url: "caigou_Edit.aspx/AutoGenerateByCG",
                    data: "{'CountDay':'" + CountRen + "','PurchaseID':'" + PurchaseID + "','CID':'" + CID + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        if (data.d == "OK") {
                            alert("生成成功！");
                            history.go(0);
                        }
                        else {
                            alert("生成失败！");
                        }
                    }
                });
            }
            if (obj) obj.style.display = "";
        }

        //获取原料名称
        function GetRawName() {

            var pinghao = $("#txt_pinhao").val();
            if (pinghao == "")
                return;
            $.ajax({
                type: "Post",
                url: "caigou_Edit.aspx/GetRawName",
                data: "{'pinghao':'" + pinghao + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d[0] == "OK") {
                        $("#txt_RawName").val(data.d[1]);
                        $("#txt_danwei").val(data.d[2]);
                        $("#txt_guige").val(data.d[3]);
                        $("#txt_danweiid").val(data.d[4]);
                    }

                }
            });
        }

        //获取需采购量
        function GetXCGNumber() {
            var pinghao = $("#txt_pinhao").val();
            var infoId = $("#HidCID").val();
            var Number = $("#txt_jhsl").val();

            $.ajax({
                type: "Post",
                url: "caigou_Edit.aspx/GetXCGNumber",
                data: "{'pinghao':'" + pinghao + "','infoId':'" + infoId + "','Number':'" + Number + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    $("#txt_xcgl").val(data.d);
                }
            });
        }


        function Add() {
            $("#div_add input[type='text']").val("");
            $("#div_add textarea").val("");
            divshow('div_add', 'div1');
        }

        function Edit_FactNum(id, num) {
            $("#hidid").val(id);
            $("#Change_FactNumber").val(num);
            divshow('div1', 'div3');
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:HiddenField ID="HidCID" runat="server" />
    
    <asp:HiddenField ID="jihua_Id" runat="server" Value="0" />
    <asp:HiddenField ID="shipu_Id" runat="server" Value="0" />
    <asp:HiddenField ID="hf_page" runat="server" Value="1" />
    <asp:HiddenField ID="newid" runat="server" Value="0" />
    <div id="div_se_1" class="nav_2" style="display: none">
        <div class="nav_2_1"><img src="../../Images/nav2_bg1.gif" /></div>
        <ul>
            <li><a href="#"><span class="lvse_border">配餐人群设置</span></a></li>
            <li><a href="#"><span class="feise_border">选择配餐日期</span></a></li>
            <li style="background: none"><a href="#"><span class="feise_border">生成食谱</span></a></li>
        </ul>
        <div class="nav_2_3"><img src="../../Images/nav2_bg2.gif" /></div>
    </div>
    <div id="div_se_2" class="nav_se" style="display: none">
        <div class="nav_se_1"><img src="../../Images/nav2_bg1.gif" /></div>
        <ul>
            <li><a href="#"><span class="lvse_border">周食谱清单</span></a></li>
            <li><a href="#"><span class="lvse_border">周食谱检查表</span></a></li>
        </ul>
        <div class="nav_se_3"><img src="../../Images/nav2_bg2.gif" /></div>
    </div>
    <div class="xxk_button" id="top_title">
        <ul>
            <li><img src="../../Images/cp_h1_01.gif" style="margin-top: 5px;" /></li>
            <li>食谱详细采购计划</li>
        </ul>
    </div>
    <div class="Center_Content" id="div2_1" style="display: block; height: 500px">
        <div class="Create_Recipe" style="height: 490px">
            <div align="center">
                <div style="width: 100%">
                    <table width="100%">
                        <tr>
                            <td>
                                <table width="100%" cellpadding="0" cellspacing="10" style="border-bottom:1px dashed #118fde; background-color:#F6F6F6;">
                                    <tr>
                                        <td style="width:230px;">
                                            原料名称：<asp:TextBox ID="txt_Name" runat="server" CssClass="input_bg"></asp:TextBox>
                                        </td>
                                        <td style="width:500px; text-align:left;">
                                            <asp:Button ID="btn_Search" runat="server" Text="查询" CssClass="input_btn_a"  
                                                OnClick="btn_Search_Click" />
                                        </td>
                                        <%if (Catering.Toolss.IsVerification(Session["RoleID"].ToString(), "cgjh.aspx", "操作"))
                                          { %>
                                        <td align="right">
                                            <input type="button" value="生成计划" class="input_btn_a" onclick='divshow("div1","div2")' />
                                        </td>
                                        <td align="right">
                                            <input type="button" id="Add_Row" onclick="Add()" value="新　增" class="input_btn_a" />
                                        </td>
                                        <td align="right">
                                            <asp:Button ID="Button1" runat="server" Text="导出Excel" CssClass="input_btn_a" OnClick="But_OutPut_Purchase_Click" />
                                        </td>
                                        <%} %>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table align="left" width="100%" border="0" cellspacing="0" cellpadding="0" class="swxx_table"
                                    id="css_xiugai">
                                    <tr>
                                        <td>
                                            <table width="100%" border="0" id="css_table">
                                                <tr>
                                                    <td style="padding-left:16px;">编号：<asp:Label ID="lab_RNo" runat="server"></asp:Label></td>
                                                    <td>版本：<asp:Label ID="lab_Vs" runat="server"></asp:Label></td>
                                                    <td>受控号：<asp:Label ID="lab_Controlled" runat="server"></asp:Label></td>
                                                    <td>编制人：<asp:Label ID="lab_BRid" runat="server"></asp:Label></td>
                                                    <td>编制时间：<asp:Label ID="lab_Date" runat="server"></asp:Label></td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                                                <thead>
                                                    <tr>
                                                        <td style="width:6%; border-left:1px solid #ccc;" align="center">序号</td>
                                                        <td style="width:10%" align="center">品号</td>
                                                        <td align="center" style="width:12%">原料名称</td>
                                                        <td align="center" style="width:10%">型号规格</td>
                                                        <td align="center" style="width:6%">单位</td>
                                                        <td align="center" style="width:10%">计划数量</td>
                                                        <td align="center" style="width:10%">库存结余</td>
                                                        <td align="center" style="width:10%">实际采购量</td>
                                                        <td align="center" style="width:6%; display:none;">折损率</td>
                                                        <td align="center" style="width:16%">备注</td>
                                                        <td align="center" style="width:10%">操作</td>
                                                    </tr>
                                                </thead>
                                                <tbody id="Purchase_Info">
                                                    <asp:Repeater runat="server" ID="Rep_PurchaseInfo">
                                                        <ItemTemplate>
                                                            <tr class="td_bgcolor" onmouseover="this.style.background='#E3F5FF'" onmouseout="this.style.background='#FFFFFF'">
                                                            <td><%#GetindexXu()%></td>
                                                            <td><%#this.Getpinhao(Eval("DID").ToString(), Eval("CID").ToString())%>&nbsp;</td>
                                                            <td><%#Eval("PName")%></td>
                                                            <td><%#this.GetRawGuiGe(Eval("DID").ToString())%>&nbsp;</td>
                                                            <td><%#this.GetUnitName(Eval("Company").ToString())%></td>
                                                            <td><%#Convert.ToDecimal(Eval("ProgramNumber")).ToString("G")%></td>
                                                            <td><%#Convert.ToDecimal(Eval("Requirement")).ToString("G")%></td><!--需采购数量-->
                                                            <td><%#Convert.ToDecimal(Eval("FactNumber")).ToString("G")%>&nbsp;</td>
                                                            <td style=" display:none;"><%#this.GetZheSunlv(Eval("DID").ToString())%></td>
                                                            <td><%#Eval("Back")%>&nbsp;</td>
                                                            <%if (Catering.Toolss.IsVerification(Session["RoleID"].ToString(), "cgjh.aspx", "操作"))
                                                              { %>
                                                            <td>
                                                            <a href="javascript:void(0);"><img src="../../Images/file.gif" onclick="Edit_FactNum('<%#Eval("ID") %>','<%#Eval("FactNumber") %>')"/>　</a>
                                                            <a href="javascript:void(0);"><img src="../../Images/trash.gif" onclick="Del_Purchase_Info('<%#Eval("id") %>')"/></a></td>
                                                            <%}
                                                              else { %>
                                                              <td>&nbsp;</td>
                                                            <%  } %>
                                                            </tr>
                                                        </ItemTemplate>
                                                    </asp:Repeater>
                                                </tbody>
                                                <tr>
                                                    <td colspan="9" class="paper_td" style="border: 0px; padding: 10px 0px;">
                                                        <div class="page">
                                                            <webdiyer:aspnetpager id="AspNetPager1" runat="server" pagesize="10" onpagechanging="AspNetPager1_PageChanging"
                                                            firstpagetext="首页" lastpagetext="尾页" nextpagetext="下一页" prevpagetext="上一页" showpageindex="true">
                                                            </webdiyer:aspnetpager>
                                                        </div>

                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <!--遮罩层-->
    <div id="div1" class="bg">
    </div>
    <!--弹出层-->
    <div id="div2" class="center_div" style="height:400px; padding:0px; margin-top: -130px;width:520px;">
        <table border="0" cellpadding="0" cellspacing="0" style="width:520px; margin:0px auto;">
            <tr>
                <td height="350">
                    <div class="div_0207 left_width400" style="width:518px; height:100%; margin-top:0px;">
                        <table width="100%" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td colspan="5"><h1><img src="../../../Images/cp_h1_03.gif" />自动生成采购计划</h1></td>
                            </tr>
                            <tr><td colspan="5" height="10"></td></tr>
                            <tr>
                                <td width="20"></td>
                                <td colspan="3" height="30" valign="middle">
                                    <input type="radio" name="selects" id="radio_1" value="" onclick="showTables(1, 2)" checked="checked" style="vertical-align:middle;" />&nbsp;&nbsp;自动生成采购计划&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="radio" name="selects" id="radio_2" onclick="showTables(2, 2)" value="" style="vertical-align:middle;" />&nbsp;&nbsp;历次采购计划模版
                                </td>
                                <td align="center"><a href="#" class="input_btn_a" onclick='ShowRecipes()'>查询</a></td>
                            </tr>
                            <tr>
                                <td width="20">
                                    <asp:HiddenField ID="HF_ClassID" runat="server" />
                                </td>
                                <td>起始日期：</td>
                                <td><asp:TextBox ID="txstattime" runat="server"  CssClass="input_bg" style="width:155px;" /></td>
                                <td>结束日期：</td>
                                <td><asp:TextBox ID="txstoptime" runat="server"  CssClass="input_bg" style="width:155px;" /></td>
                            </tr>
                            <tr>
                                <td colspan="5">
                                    <table align="left" style="width: 100%;" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td colspan="2">
                                                <div style="height: 245px; overflow-y:auto;">
                                                    <table id="table_1" width="100%" border="0" cellspacing="0" cellpadding="0" class="swxx_table" style="margin-top:10px;">
                                                        <thead>
                                                            <tr>
                                                                <td style="width:10%">选择</td>
                                                                <td style="width:24%">名称</td>
                                                                <td style="width:16%">周期</td>
                                                                <td style="width:20%">配餐开始时间</td>
                                                                <td style="width:20%">配餐截止时间</td>
                                                                <td style="width:10%">人数</td>
                                                            </tr>
                                                        </thead>
                                                        <tbody id="shipu_List"></tbody>
                                                    </table>
                                                    <table id="table_2" width="100%" border="0" cellspacing="0" cellpadding="0" style="display:none">
                                                        <tr>
                                                            <td>
                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                                                    <tr>
                                                                        <td width="20"></td>
                                                                        <td width="67" height="40">人　　数：</td>
                                                                        <td align="left">
                                                                            <asp:TextBox runat="server" ID="txt_Number"  CssClass="input_bg" style="width:155px;" />&nbsp;&nbsp;人
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td width="100%">
                                                                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="swxx_table">
                                                                    <thead>
                                                                        <tr>
                                                                            <td style="width:10%">选择</td>
                                                                            <td style="width:26%">采购计划名称</td>
                                                                            <td style="width:21%">修订人</td>
                                                                            <td style="width:22%">修订时间</td>
                                                                            <td style="width:21%">采购周期（天）</td>
                                                                        </tr>
                                                                    </thead>
                                                                    <tbody id="jihua_List"></tbody>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
            <tr>
                <td height="40">
                    <table align="center">
                        <tr class="img_touxiang" >
                            <td align="center">
                                <a href="#" id="KaiShiSC" onclick="AutoGenerate()">开始生成</a>
                            </td>
                            <td align="center">
                                <a href="#" onclick='divhidel("div1","div2")'>关闭</a>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>

    <div id="div_add" isadd="true" class="tc_css">
        <h2><b>添加食谱采购计划</b><span onclick="divhidel('div1','div_add')" title="关闭">[×]</span></h2>
        <div class="tc_conter">
            <table border="0" cellpadding="0" cellspacing="0" width="450" align="center">
                <tr>
                    <td height="40" width="75" align="right">品号：</td>
                    <td width="150"><asp:TextBox ID="txt_pinhao" runat="server" onpropertychange="GetRawName()" CssClass="input_bg" style="width:150px;"></asp:TextBox></td>
                    <td width="75" align="right">原料名称：</td>
                    <td width="150"><asp:TextBox ID="txt_RawName" runat="server" CssClass="input_bg" style="width:150px;"></asp:TextBox></td>
                </tr>
                <tr>
                    <td height="40" align="right">型号规格：</td>
                    <td><asp:TextBox ID="txt_guige" runat="server" CssClass="input_bg" style="width:150px;"></asp:TextBox></td>
                    <td align="right">单位：</td>
                    <td>
                        <asp:TextBox ID="txt_danwei" runat="server" CssClass="input_bg" style="width:150px;"></asp:TextBox>
                        <asp:HiddenField ID="txt_danweiid" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td height="40" align="right">计划数量：</td>
                    <td><asp:TextBox ID="txt_jhsl" runat="server" onpropertychange="GetXCGNumber()" CssClass="input_bg" style="width:150px;"></asp:TextBox></td>
                    <td align="right">库存结余：</td>
                    <td><asp:TextBox ID="txt_xcgl" runat="server" CssClass="input_bg" style="width:150px;"></asp:TextBox></td>
                </tr>
                <tr>
                    <td height="40" align="right">实采购量：</td>
                    <td><asp:TextBox ID="txt_FactNumber" runat="server" CssClass="input_bg" style="width:150px;"></asp:TextBox></td>
                    <td align="right"></td>
                    <td></td>
                </tr>
                <tr>
                    <td height="60"  align="right">备注：</td>
                    <td colspan="3"><asp:TextBox ID="txt_bz" TextMode="MultiLine" CssClass="input_bg" Style="height: 50px; width:376px;" runat="server"></asp:TextBox></td>
                </tr>
                <tr>
                    <td height="40"></td>
                    <td><asp:Button ID="btn_tijiao" runat="server" Text="确认" OnClick="btn_tijiao_Click" class="input_btn_a" /></td>
                    <td colspan="2" align="center"><input type="button" id="btn_quxiao" value="取消" onclick="divhidel('div1','div_add')" class="input_btn_a" /></td>
                </tr>
            </table>
        </div>
    </div>

    <div id="div3" isadd="true" class="tc_css" style="width:280px;">
        <h2><b>修改实际采购量</b><span onclick="divhidel('div1','div3')" title="关闭">[×]</span></h2>
        <div class="tc_conter">
            <table border="0" cellpadding="0" cellspacing="0" align="center">
                <tr>
                    <td align="right" height="50">实采购量：</td>
                    <td>
                        <asp:TextBox ID="Change_FactNumber" runat="server" CssClass="input_bg" style="width:150px;"></asp:TextBox>
                        <asp:HiddenField ID="hidid" runat="server" />
                    </td>
                </tr>                
                <tr>
                    <td colspan="2" valign="top" align="center" height="40"><asp:Button ID="Button2" runat="server" Text="确认" OnClick="btn_FactNumberChange" class="input_btn_a" /></td>
                </tr>
            </table>
        </div>
    </div>
    <div class="footer">
        <strong>中海油能源发展配餐服务公司渤海自营油田作业公司&nbsp;&nbsp;版权所有@CopyRight 2012</strong><span>技术支持：北京天择嘉业科技有限公司</span>
    </div>
    </form>
</body>
</html>
